 package srdb.migration.dbhandler.mysql;
 
   
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.ArrayList;
 import java.util.Arrays;
import java.util.Hashtable;

import srdb.migration.MigrationToolkit;
import srdb.migration.Utility;
import srdb.migration.common.IMTKConnection;
import srdb.migration.common.MTKConstants;
import srdb.migration.common.MTKMetaData;
import srdb.migration.common.MTKConstants.DATABASE_TYPE;
import srdb.migration.schema.metadata.Column;
import srdb.migration.schema.metadata.ColumnList;
import srdb.migration.schema.metadata.Constraint;
import srdb.migration.schema.metadata.ConstraintList;
import srdb.migration.schema.metadata.EnumType;
import srdb.migration.schema.metadata.Index;
import srdb.migration.schema.metadata.IndexList;
import srdb.migration.schema.metadata.Schema;
import srdb.migration.schema.metadata.Table;
import srdb.migration.schema.metadata.View;
 
 public class MetaData extends MTKMetaData
 {
   private IMTKConnection conn = null;
   private DatabaseMetaData metaData = null;
 
   private String commaSepViewNames = null;
   private String commaSepTableNames = null;
 
   public MetaData(IMTKConnection conn)
     throws Exception
   {
     this.conn = conn;
     this.dbConn = conn.getConnection();
     this.metaData = this.dbConn.getMetaData();
   }
 
   public MetaData(IMTKConnection conn, String targetSchemaName)
     throws Exception
   {
     this.conn = conn;
     this.dbConn = conn.getConnection();
 
     this.targetSchemaName = targetSchemaName;
     this.metaData = this.dbConn.getMetaData();
   }
 
   public String escape(String name)
   {
     return "`" + name + "`";
   }
 
   public String escapeWildCharacters(String objectName, String escapeString)
   {
     StringBuilder strBuilder = new StringBuilder();
 
     for (int i = 0; i < objectName.length(); i++) {
       char ch = objectName.charAt(i);
       if ((ch == '_') || (ch == '%'))
         strBuilder.append(escapeString + ch);
       else {
         strBuilder.append(ch);
       }
     }
     return strBuilder.toString();
   }
 
   public boolean isVersion5OrGreater()
     throws SQLException
   {
     return this.metaData.getDatabaseMajorVersion() >= 5;
   }
 
   protected void initTableStatement(String commaSepTableNames)
     throws SQLException
   {
     this.commaSepTableNames = removeSingleQuotes(commaSepTableNames);
   }
 
   public void getTables(String commaSepTableNames, boolean importViewAsTable)
     throws SQLException
   {
     super.getTables(removeSingleQuotes(commaSepTableNames), importViewAsTable);
 
     if (importViewAsTable) {
       initViewStatement(commaSepTableNames);
       getViewsAsTables();
     }
   }
 
   protected void getTables()
     throws SQLException
   {
     Statement stmt = null;
     try {
       stmt = this.conn.getConnection().createStatement();
       stmt.executeQuery("USE " + escape(this.schema.getName()));
     } catch (SQLException exp) {
       throw processException(new SQLException("Following problem occurred while using specified source schema.\n" + exp.getMessage()));
     } finally {
       if (stmt != null) {
         stmt.close();
       }
     }
     writeLog("Getting Table Definitions");
 
     Table table = null;
 
     if ((this.commaSepTableNames != null) && (this.commaSepTableNames.trim().length() > 0)) {
       String[] tableNames = this.commaSepTableNames.split(",");
       for (String name : tableNames) {
         table = getTable(name);
         if (table != null)
           this.schema.addTable(table);
       }
     } else {
       ResultSet rs = null;
       try {
         if ((this.metaData.getDatabaseMajorVersion() >= 5) && (this.metaData.getDatabaseMinorVersion() >= 1)) {
           rs = this.metaData.getTables(this.schema.getName(), "%", "%", new String[] { "TABLE" });
         }
         else {
           rs = this.metaData.getTables(escapeWildCharacters(this.schema.getName(), this.metaData.getSearchStringEscape()), "%", "%", new String[] { "TABLE" });
         }
 
         if (rs != null)
           while (rs.next()) {
             table = getTable(rs.getString(3));
             if (table != null)
               this.schema.addTable(table);
           }
       }
       catch (SQLException exp) {
         throw processException(exp);
       } finally {
         if (rs != null)
           rs.close();
       }
     }
   }
 
   private void getViewsAsTables()
     throws SQLException
   {
     writeLog("Getting View Definitions");
     if ((this.commaSepViewNames != null) && (this.commaSepViewNames.trim().length() > 0))
     {
       String[] viewNames = this.commaSepViewNames.split(",");
       ResultSet rs = null;
       try {
         rs = this.metaData.getTables(escapeWildCharacters(this.schema.getName(), this.metaData.getSearchStringEscape()), "%", "%", new String[] { "VIEW" });
 
         if (rs != null) {
           Table table = null;
           while (rs.next())
             if (Arrays.binarySearch(viewNames, rs.getString(3)) >= 0) {
               table = getTable(rs.getString(3));
               if (table != null)
                 this.schema.addTable(table);
             }
         }
       }
       catch (SQLException exp) {
         throw processException(exp);
       } finally {
         if (rs != null)
           rs.close();
       }
     }
   }
 
   protected void initColumnStatement()
     throws SQLException
   {
   }
 
   protected Table getTable(String tableName)
     throws SQLException
   {
     ResultSet rs = null;
     Table table = null;
     boolean colCaseSensitive = false;
     try
     {
       rs = this.metaData.getColumns(this.schema.getName(), "%", escapeWildCharacters(tableName, this.metaData.getSearchStringEscape()), "%");
       while (rs.next()) {
         if (table == null) {
           table = new Table(this.schema, tableName, this.targetSchemaName);
         }
 
         String colName = rs.getString(4);
 
         Column column = new Column(table, colName);
 
         String typeName = rs.getString("TYPE_NAME");
         MigrationToolkit mtk = MigrationToolkit.getInstance();
         if (typeName.equalsIgnoreCase("enum")) {
           String enumDef = getEnumColDefinition(tableName, colName);
           typeName = tableName + "_" + colName + "_enum";
           EnumType et = new EnumType(typeName, null, enumDef);
           table.addEnumType(et);
         }
         if ((mtk.getTargetDBType() == MTKConstants.DATABASE_TYPE.SRDB) || (mtk.isTargetDBInPPASPGMode()))
         {
           table.addColumn(toPGType(column, typeName, rs.getInt(7), rs.getInt(7), rs.getInt(9), rs.getString(18), isCaseSensitive(colName), rs.getString(13), rs.getString(12)));
         }
         else
         {
           table.addColumn(toEDBType(column, typeName, rs.getInt(7), rs.getInt(7), rs.getInt(9), rs.getString(18), isCaseSensitive(colName), rs.getString(13), rs.getString(12)));
         }
       }
 
     }
     catch (SQLException se)
     {
       throw processException(se);
     } finally {
       if (rs != null) {
         rs.close();
       }
     }
 
     return table;
   }
 
   private String getEnumColDefinition(String tableName, String columnName) throws SQLException {
     String sql = "show columns from " + tableName + " where Field='" + columnName + "'";
     Statement stmt = this.conn.getConnection().createStatement();
     String def = null;
     SQLException ex = null;
     try {
       ResultSet rs = stmt.executeQuery(sql);
       if (rs.next())
         def = rs.getString("TYPE");
     }
     catch (SQLException exp) {
       exp.printStackTrace();
       ex = exp;
     } finally {
       stmt.close();
     }
     if (ex != null) {
       throw ex;
     }
     return def;
   }
 
   private Column toEDBType(Column column, String typeName, int length, int precision, int scale, String nullable, boolean caseSensitive, String defaultClause, String comments)
   {
     typeName = typeName.trim();
 
     if (typeName.equalsIgnoreCase("TINYINT UNSIGNED")) {
       typeName = "TINYINT";
     } else if ((typeName.equalsIgnoreCase("SMALLINT UNSIGNED")) || (typeName.equalsIgnoreCase("MEDIUMINT")) || (typeName.equalsIgnoreCase("MEDIUMINT UNSIGNED")))
     {
       typeName = "INT";
     } else if (typeName.equalsIgnoreCase("INT UNSIGNED")) {
       typeName = "BIGINT";
     } else if (typeName.equalsIgnoreCase("BIGINT UNSIGNED")) {
       typeName = "NUMERIC";
       precision = 20;
       scale = 0;
     } else if (typeName.equalsIgnoreCase("DECIMAL")) {
       typeName = "NUMERIC";
     } else if ((typeName.equalsIgnoreCase("DOUBLE")) || (typeName.equalsIgnoreCase("DOUBLE UNSIGNED")))
     {
       typeName = "DOUBLE PRECISION";
     } else if ((typeName.equalsIgnoreCase("TINYTEXT")) || (typeName.equalsIgnoreCase("TEXT")) || (typeName.equalsIgnoreCase("MEDIUMTEXT")) || (typeName.equalsIgnoreCase("LONGTEXT")))
     {
       typeName = "CLOB";
     } else if ((typeName.equalsIgnoreCase("TINYBLOB")) || (typeName.equalsIgnoreCase("MEDIUMBLOB")) || (typeName.equalsIgnoreCase("LONGBLOB")))
     {
       typeName = "BLOB";
     }
     if (typeName.toUpperCase().indexOf("UNSIGNED") > 0)
     {
       typeName = typeName.substring(0, typeName.toUpperCase().indexOf("UNSIGNED"));
     }
 
     column.addDetail(typeName.trim(), length, precision, scale, nullable, caseSensitive, defaultClause, comments, null);
 
     return column;
   }
 
   private Column toPGType(Column column, String typeName, int length, int precision, int scale, String nullable, boolean caseSensitive, String defaultClause, String comments)
   {
     typeName = typeName.trim();
 
     if (typeName.toUpperCase().startsWith("TINYINT")) {
       typeName = "SMALLINT";
     } else if ((typeName.equalsIgnoreCase("SMALLINT UNSIGNED")) || (typeName.toUpperCase().startsWith("MEDIUMINT")))
     {
       typeName = "INT";
     } else if (typeName.equalsIgnoreCase("INT UNSIGNED")) {
       typeName = "BIGINT";
     } else if (typeName.equalsIgnoreCase("BIGINT UNSIGNED")) {
       typeName = "NUMERIC";
       precision = 20;
       scale = 0;
     } else if (typeName.equalsIgnoreCase("DECIMAL")) {
       typeName = "NUMERIC";
     } else if (typeName.toUpperCase().startsWith("DOUBLE")) {
       typeName = "DOUBLE PRECISION";
     } else if ((typeName.equalsIgnoreCase("TINYTEXT")) || (typeName.equalsIgnoreCase("TEXT")) || (typeName.equalsIgnoreCase("MEDIUMTEXT")) || (typeName.equalsIgnoreCase("LONGTEXT")))
     {
       typeName = "TEXT";
     } else if ((typeName.equalsIgnoreCase("BLOB")) || (typeName.equalsIgnoreCase("TINYBLOB")) || (typeName.equalsIgnoreCase("MEDIUMBLOB")) || (typeName.equalsIgnoreCase("LONGBLOB")) || (typeName.equalsIgnoreCase("BINARY")))
     {
       typeName = "BYTEA";
     } else if (typeName.equalsIgnoreCase("DATETIME")) {
       typeName = "TIMESTAMP(3)";
     } else if (typeName.equalsIgnoreCase("YEAR")) {
       typeName = "NUMERIC";
 
       if (precision <= 0) {
         precision = 4;
         scale = 0;
       }
     }
 
     if (typeName.toUpperCase().indexOf("UNSIGNED") > 0)
     {
       typeName = typeName.substring(0, typeName.toUpperCase().indexOf("UNSIGNED"));
     }
 
     column.addDetail(typeName.trim(), length, precision, scale, nullable, caseSensitive, defaultClause, comments, null);
 
     return column;
   }
 
   protected void initViewStatement(String commaSepViewNames)
     throws SQLException
   {
     this.commaSepViewNames = removeSingleQuotes(commaSepViewNames);
   }
 
   private View getView(String viewName)
     throws SQLException
   {
     View view = null;
     ResultSet rs = null;
     Statement stmt = null;
     try
     {
       this.getViewsStr = ("SHOW CREATE TABLE " + escape(this.schema.getName()) + "." + escape(viewName));
       stmt = this.conn.getConnection().createStatement();
       rs = stmt.executeQuery(this.getViewsStr);
 
       if ((rs != null) && (rs.next())) {
         view = new View(viewName, getSchema().getName());
         String viewSource = rs.getString(2);
 
         int index = viewSource.toUpperCase().indexOf("AS SELECT");
         if (index >= 0) {
           viewSource = viewSource.substring(index + 2);
           viewSource = viewSource.replaceAll("`", "\"");
         }
 
         Table viewTable = getTable(view.getName());
 
         if (viewTable != null) {
           for (int i = 0; i < viewTable.getColumns().size(); i++) {
             Column viewTableCol = viewTable.getColumns().get(i);
             if ((viewTableCol.isCaseSensitive()) || (!Utility.isValidEDBIdentifier(viewTableCol.getName()))) {
               continue;
             }
             viewSource = viewSource.replaceAll("\"" + viewTableCol.getName() + "\"", viewTableCol.getName());
           }
 
         }
 
         view.setSQL(viewSource);
       }
     } catch (SQLException se) {
       throw processException(se);
     } finally {
       if (rs != null) {
         rs.close();
       }
 
       if (stmt != null) {
         stmt.close();
       }
     }
     return view;
   }
 
   protected void getViews()
     throws SQLException
   {
     writeLog("Getting View Definitions");
     View view = null;
 
     if ((this.commaSepViewNames != null) && (this.commaSepViewNames.trim().length() > 0)) {
       String[] viewNames = this.commaSepViewNames.split(",");
       for (String name : viewNames) {
         view = getView(name);
         if (view != null)
           this.schema.addView(view);
       }
     }
     else {
       ResultSet rs = null;
       try {
         rs = this.metaData.getTables(escapeWildCharacters(this.schema.getName(), this.metaData.getSearchStringEscape()), "%", "%", new String[] { "VIEW" });
 
         if (rs != null)
           while (rs.next()) {
             view = getView(rs.getString(3));
             if (view != null)
               this.schema.addView(view);
           }
       }
       catch (SQLException exp) {
         throw processException(exp);
       } finally {
         if (rs != null)
           rs.close();
       }
     }
   }
 
   protected void initConstraintStatement(String commaSepTableNames)
     throws SQLException
   {
     this.commaSepTableNames = removeSingleQuotes(commaSepTableNames);
   }
 
   protected void getConstraints()
     throws SQLException
   {
     writeLog("Getting Constraint Definitions");
     if ((this.commaSepTableNames != null) && (this.commaSepTableNames.length() > 0)) {
       String[] tableNames = this.commaSepTableNames.split(",");
       for (String name : tableNames)
         getTableConstraints(name);
     }
     else {
       ResultSet rs = null;
       try
       {
         rs = this.metaData.getTables(this.schema.getName(), "%", "%", new String[] { "TABLE" });
 
         if (rs != null)
           while (rs.next())
             getTableConstraints(rs.getString(3));
       }
       catch (SQLException exp) {
         throw processException(exp);
       } finally {
         if (rs != null) {
           rs.close();
         }
 
       }
 
     }
 
     ConstraintList list = this.schema.getConstraints();
     if ((list != null) && (list.size() > 0)) {
       Constraint constraint = null;
       ArrayList cnames = new ArrayList();
       for (int i = 0; i < list.size(); i++) {
         constraint = list.get(i);
         if ((!constraint.getName().equalsIgnoreCase("PRIMARY")) && (!constraint.getName().equalsIgnoreCase("\"PRIMARY\"")) && (cnames.contains(constraint.getName())))
         {
           constraint.setName(null);
         }
         else cnames.add(constraint.getName());
       }
     }
   }
 
   private void getTableConstraints(String tableName)
     throws SQLException
   {
     Constraint constraint = null;
     Hashtable cache = new Hashtable();
     String colName = null;
     Column column = null;
     ResultSet rs = null;
     try
     {
       rs = this.metaData.getPrimaryKeys(this.schema.getName(), "%", tableName);
 
       if (rs != null)
       {
         String pkOriginalName = null;
         String pkName = null;
         while (rs.next())
         {
           pkOriginalName = rs.getString("PK_NAME");
           pkName = pkOriginalName;
           if (pkOriginalName == null) {
             pkName = "PRIMARY";
           }
 
           if (!cache.containsKey(pkName)) {
             constraint = new Constraint(getTable(rs.getString("TABLE_NAME")), pkName, isCaseSensitive(pkName));
 
             constraint.setType(MTKConstants.CONST_PRIMARY);
             cache.put(pkName, constraint);
             this.schema.addConstraint(constraint);
           } else {
             constraint = (Constraint)cache.get(pkName);
           }
 
           colName = rs.getString("COLUMN_NAME");
           column = new Column(colName);
           column.setCaseSensitive(isCaseSensitive(colName));
           constraint.addColumn(column);
         }
       }
     } catch (SQLException exp) {
       throw processException(exp);
     } finally {
       if (rs != null) {
         rs.close();
       }
     }
     cache.clear();
     try
     {
       rs = this.metaData.getImportedKeys(this.schema.getName(), "%", tableName);
 
       if (rs != null) {
         String keyName = null;
         while (rs.next()) {
           keyName = rs.getString("FK_NAME");
           if (keyName == null)
           {
             keyName = rs.getString("FKTABLE_NAME") + "_fk" + rs.getShort("KEY_SEQ");
           }
 
           if (!cache.containsKey(keyName)) {
             constraint = new Constraint(getTable(rs.getString("FKTABLE_NAME")), keyName, isCaseSensitive(keyName));
 
             constraint.setType(MTKConstants.CONST_FOREIGN);
             constraint.setDeleteRule(MTKConstants.translateDeleteRule(rs.getShort("DELETE_RULE")));
 
             cache.put(keyName, constraint);
             this.schema.addConstraint(constraint);
           } else {
             constraint = (Constraint)cache.get(keyName);
           }
 
           colName = rs.getString("FKCOLUMN_NAME");
           column = new Column(colName);
           column.setCaseSensitive(isCaseSensitive(colName));
           constraint.addColumn(column);
 
           constraint.setRefIntegrityTable(rs.getString("PKTABLE_NAME"));
           colName = rs.getString("PKCOLUMN_NAME");
           column = new Column(colName);
           column.setCaseSensitive(isCaseSensitive(colName));
           constraint.addRefIntegrityColumn(column);
         }
       }
     } catch (SQLException exp) {
       throw processException(exp);
     } finally {
       if (rs != null) {
         rs.close();
       }
     }
     cache.clear();
 
     this.getConstraintsStr = ("SHOW KEYS FROM " + escape(this.schema.getName()) + "." + escape(tableName));
     if (isVersion5OrGreater())
       this.getConstraintsStr += " WHERE KEY_NAME != 'PRIMARY' AND NON_UNIQUE=0";
     try
     {
       rs = this.conn.getConnection().createStatement().executeQuery(this.getConstraintsStr);
       if (rs != null) {
         String keyName = null;
         while (rs.next()) {
           keyName = rs.getString(3);
           if (!cache.containsKey(keyName)) {
             constraint = new Constraint(getTable(rs.getString(1)), keyName, isCaseSensitive(keyName));
 
             constraint.setType(MTKConstants.CONST_UNIQUE);
             cache.put(keyName, constraint);
             this.schema.addConstraint(constraint);
           } else {
             constraint = (Constraint)cache.get(keyName);
           }
 
           colName = rs.getString(5);
           column = new Column(colName);
           column.setCaseSensitive(isCaseSensitive(colName));
           constraint.addColumn(column);
         }
       }
     } catch (SQLException exp) {
       throw processException(exp);
     } finally {
       if (rs != null) {
         rs.close();
       }
     }
     cache.clear();
     cache = null;
   }
 
   protected void setConstraintColumnsPSParams(Constraint constraint)
     throws SQLException
   {
   }
 
   protected void initIndexeStatement(String commaSepTableNames)
     throws SQLException
   {
     this.commaSepTableNames = removeSingleQuotes(commaSepTableNames);
   }
 
   protected void getIndexes()
     throws SQLException
   {
     writeLog("Getting Index Definitions");
     if ((this.commaSepTableNames != null) && (this.commaSepTableNames.trim().length() > 0))
     {
       String[] tableNames = this.commaSepTableNames.split(",");
       for (String name : tableNames)
         getTableIndexes(name);
     }
     else {
       ResultSet rs = null;
       try {
         rs = this.metaData.getTables(escapeWildCharacters(this.schema.getName(), this.metaData.getSearchStringEscape()), "%", "%", new String[] { "TABLE" });
 
         if (rs != null)
           while (rs.next())
             getTableIndexes(rs.getString(3));
       }
       catch (SQLException exp)
       {
         throw processException(exp);
       } finally {
         if (rs != null) {
           rs.close();
         }
 
       }
 
     }
 
     IndexList list = this.schema.getIndexes();
     if ((list != null) && (list.size() > 0)) {
       Index index = null;
       String name = null;
 
       ArrayList indexNames = new ArrayList();
 
       ConstraintList constraints = this.schema.getConstraints();
       if ((constraints != null) && (constraints.size() > 0)) {
         for (int i = 0; i < constraints.size(); i++) {
           indexNames.add(constraints.get(i).getName());
         }
       }
 
       int[] indexCount = new int[list.size() + indexNames.size()];
       for (int i = 0; i < list.size(); i++) {
         index = list.get(i);
         name = index.getName();
         if (indexNames.contains(name)) {
           indexCount[indexNames.indexOf(name)] += 1;
           index.setName(name + indexCount[indexNames.indexOf(name)]);
         } else {
           indexNames.add(name);
           indexCount[indexNames.indexOf(name)] = 0;
         }
       }
     }
   }
 
   private void getTableIndexes(String tableName)
     throws SQLException
   {
     Hashtable cache = new Hashtable();
     Index index = null;
     String colName = null;
     Column column = null;
 
     this.getIndexesStr = ("SHOW KEYS FROM " + escape(this.schema.getName()) + "." + escape(tableName));
     if (isVersion5OrGreater()) {
       this.getIndexesStr += "  WHERE KEY_NAME != 'PRIMARY' AND NON_UNIQUE=1";
     }
     ResultSet rs = null;
     try {
       rs = this.conn.getConnection().createStatement().executeQuery(this.getIndexesStr);
       if (rs != null) {
         String indexName = null;
         while (rs.next()) {
           indexName = rs.getString(3);
           if (!cache.containsKey(indexName))
           {
             if ((indexName.equalsIgnoreCase("PRIMARY")) || (rs.getString(2).equals("0")) || (rs.getString(2).equalsIgnoreCase("false")))
             {
               continue;
             }
 
             index = new Index(getTable(rs.getString(1)), indexName);
 
             index.setUnique(false);
             cache.put(indexName, index);
             this.schema.addIndex(index);
           } else {
             index = (Index)cache.get(indexName);
           }
 
           colName = rs.getString(5);
           column = new Column(colName);
           column.setCaseSensitive(isCaseSensitive(colName));
           index.addColumn(column);
         }
       }
     } catch (SQLException exp) {
       throw processException(exp);
     } finally {
       if (rs != null) {
         rs.close();
       }
     }
     cache.clear();
     cache = null;
   }
 
   public boolean isCaseSensitive(String identifierName)
   {
     return Utility.isCaseSensitive(identifierName, MTKConstants.DATABASE_TYPE.MYSQL);
   }
 
   public void executeScript(String sql)
     throws SQLException
   {
     Statement stmt = null;
     try
     {
       if (sql.compareTo("") != 0)
       {
         stmt = this.dbConn.createStatement();
         stmt.execute(sql);
       }
     } catch (SQLException se) {
       throw processException(se);
     } finally {
       if (stmt != null)
         stmt.close();
     }
   }
 
   private SQLException processException(SQLException exp)
   {
     return Utility.processException(exp);
   }
 
   public boolean supportsSynonyms()
   {
     return false;
   }
   public String getVersion() throws SQLException { return ""; } 
   protected void initSynonymStatement(String commaSepSynNames) throws SQLException {
   }
   protected void initSequenceStatement(String commaSepSequenceNames) throws SQLException {
   }
   protected void initProcStatement(String commaSepProcNames) throws SQLException {
   }
   protected void initPackageStatement(String commaSepPackageNames) throws SQLException {  }
 
   protected void initTriggerStatement(String commaSepTableNames) throws SQLException {  }
 
   protected void getPublicSynonyms() throws SQLException {  }
 
   protected void getTriggers() throws SQLException {  }
 
   protected void getSequences() throws SQLException {  }
 
   protected void getPackages() throws SQLException {  }
 
   protected void getProcedures() throws SQLException {  }
 
   protected void getFunctions() throws SQLException {  }
 
   protected void initAllPublicSynonymStatement() throws SQLException { throw new UnsupportedOperationException("Not supported yet."); }
 
   protected void initAllPrivateSynonymStatement()
     throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   protected void getAllPublicSynonyms() throws SQLException {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   protected void getAllPrivateSynonyms()
     throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   public String[] getSchemas()
     throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   protected void initDBLinkStatement() throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   protected void getDBLinks() throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   protected void getRoles() throws SQLException
   {
   }
 
   protected void getUsers() throws SQLException
   {
   }
 
   protected void initRoleStatement(String commaSepRoleNames) throws SQLException
   {
   }
 
   protected void initUserStatement(String commaSepUserNames) throws SQLException
   {
   }
 
   protected void initGrantStatement(String commaSepUserNames) throws SQLException {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   protected void getGrants() throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   public int getDBServerMajorVersion() throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   public int getDBServerMinorVersion() throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   protected void initRulesStatement(String commaSepRuleNames) throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   protected void getRules() throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   protected void initGroupsStatement(String commaSepGroupNames) throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   protected void getGroups() throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   public String getDatabaseName()
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   protected void initDomainsStatement(String commaSepDomainNames) throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   protected void getDomains() throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   protected void initCustomDataTypesStatement(String commaSepTypes) throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }
 
   protected void getCustomDataTypes() throws SQLException
   {
     throw new UnsupportedOperationException("Not supported yet.");
   }

@Override
public void parseTables() throws SQLException {
	// TODO Auto-generated method stub
	
}

   @Override
   public String getParseTablesMsg() throws SQLException {
     return null;
   }
 }

/* 

 * 
 */